//
//  LPTWithDrawTableFooterView.m
//  LPTClient
//
//  Created by mac on 2018/12/6.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTWithDrawTableFooterView.h"

@implementation LPTWithDrawTableFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self initSubViews];
    }
    return self;
}

-(void)initSubViews
{
    self.backgroundColor = [UIColor clearColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:@"立即提现" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.backgroundColor = kThemeOrigionColor;
    button.layer.cornerRadius = 4.0f;
    button.clipsToBounds = YES;
    [button addTarget:self action:@selector(saveAction:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(12);
        make.trailing.mas_equalTo(-12);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth - 24, 44));
        make.top.mas_equalTo(50);
    }];
    
    return;
    
    UILabel *descLabel = [[UILabel alloc] init];
    descLabel.text = @"提现说明";
    descLabel.textColor = [UIColor blackColor];
    [self addSubview:descLabel];
    [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.leading.mas_equalTo(12);
        make.top.mas_equalTo(button).mas_offset(40);
    }];
    
    UILabel *detailLabel = [[UILabel alloc] init];
    detailLabel.numberOfLines = 0;
    detailLabel.text = @"(1)请在“我的账户”中设置好账户提现信息，如支付宝或银行收款账号。\n(2)支付宝设置要求：支付宝必须实名认证...";
    detailLabel.textColor = kThemeGrayColor;
    [self addSubview:detailLabel];
    [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(12);
        make.top.mas_equalTo(descLabel).mas_offset(30);
    }];
}

-(void)saveAction:(UIButton *)button
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(withDrawTableFooterViewDidClickDraw)]) {
        [self.delegate withDrawTableFooterViewDidClickDraw];
    }
}

@end
